package com.leezhen.microcloud.rest;

import com.leezhen.vo.Company;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.web.bind.annotation.*;

@RestController
public class CompanyRest {

    @RequestMapping(value = "/company/get/{title}", method = RequestMethod.GET)
    @HystrixCommand // 如果当前调用的get()方法出现了错误，则执行fallback方法
    public Object get(@PathVariable("title") String title) {
        Company vo = new Company();
        vo.setTitle(title);
        vo.setNote("www.leezhen.com");
        return vo;
    }

}
